package com.py.credit.service;

import java.util.List;
import java.util.Map;

public interface RuleBindingService {
    public void addTableRuleBinding(int ruleId, int tableId, Integer version);

    public void addColmnBinding(int ruleId, String filedId, String extend, Integer version);

    /**
     * @param id
     * @param ruleId  规则ID
     * @param tableId 表ID
     * @param extend   扩展
     * @param isDel    是否删除
     * @Function 插入更新表规则绑定信息，ID不存在插入，ID存在更新
     * @FileName RuleBindingService.java
     * @MethodName updateTableBinding
     * @Date 2018年6月12日 上午9:55:10
     * @Author Min DongXv
     */
    public void updateTableBinding(Long id, int ruleId, int tableId, String extend, String isDel, Integer version);

    /**
     * @param id
     * @param rule_id
     * @param filed_code
     * @param extend
     * @param isDel
     * @Function 更新字段绑定规则，id不存在插入，否则更新
     * @FileName RuleBindingService.java
     * @MethodName updateColmnBinding
     * @Date 2018年6月11日 下午5:40:42
     * @Author Min DongXv
     */
    public void updateColmnBinding(Long id, int ruleId, String filedCode, String extend, String isDel, Integer version);

    public void copyTableBingding(int ruleId, int tableId, int oldEditionId, int newEditionId);

    public void copyColmnBingding(int ruleId, String filedCode, int oldEditionId, int newEditionId, String extend);

    public List<Integer> selectTableBinding(int tableId, Integer version);

    public List<Map<String, Object>> selectColmnBinding(String filedCode, Integer version);

    /**
     * @return
     * @Function 获取当前启用版本
     * @FileName RuleBindingService.java
     * @MethodName selectCurrentContentVersion
     * @Date 2018年7月26日 下午4:14:17
     * @Author Min DongXv
     */
    Integer selectCurrentContentVersion();

    public void bindTableRule(int ruleId, String extend, String tableId, Integer version);

    public void bindColumnRule(int ruleId, String extend, int fieldId, String fieldCode, String tableId, Integer version);

    public void deleteBindColumnRule(int ruleId, Integer tableId, int fieldId, Integer version);

    public void deleteBindTableRule(int ruleId, int tableId, Integer version);

}
